// 时间戳转年月日时分秒 默认格式yyyy-MM-dd HH:mm:ss
export const tsToDateAndTime = (timestamp, separator = '-', sep2 = ':', sep3 = ' ') => {
	const dateObj = new Date(timestamp) // 创建Date对象
	const year = dateObj.getFullYear() // 获取年份
	const month = ("0" + (dateObj.getMonth() + 1)).slice(-2) // 获取月份，并补零
	const day = ("0" + dateObj.getDate()).slice(-2) // 获取日期，并补零
	const hour = ('0' + dateObj.getHours()).slice(-2);
	const minute = ('0' + dateObj.getMinutes()).slice(-2);
	const second = ('0' + dateObj.getSeconds()).slice(-2);
	return `${year}${separator}${month}${separator}${day}${sep3}${hour}${sep2}${minute}${sep2}${second}`
}

// 状态码 => 状态文案 1=审核中 2=已拒绝 3=已打款 4=待财务审核 5=待打款
export const getStatusTxt = (status) => {
	if (status == '1') return '审核中'
	else if (status == '2') return '已拒绝'
	else if (status == '3') return '已打款'
	else if (status == '4') return '待财务审核'
	else if (status == '5') return '待打款'
	return '未知状态'
}